package cn.wolfcode.shop.server.service.impl;

import cn.wolfcode.shop.api.domain.SkuPropertyValue;
import cn.wolfcode.shop.api.service.ISkuPropertyValueService;
import cn.wolfcode.shop.server.mapper.SkuPropertyValueMapper;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class SkuPropertyValueServiceImpl implements ISkuPropertyValueService {

    @Autowired
    SkuPropertyValueMapper skuPropertyValueMapper;

    @Override
    public int save(SkuPropertyValue skuPropertyValue) {
        return skuPropertyValueMapper.insert(skuPropertyValue);
    }

    @Override
    public int update(SkuPropertyValue skuPropertyValue) {
        return skuPropertyValueMapper.updateByPrimaryKey(skuPropertyValue);
    }

    @Override
    public SkuPropertyValue get(Long id) {
        return skuPropertyValueMapper.selectByPrimaryKey(id);
    }

    @Override
    public int delete(Long id) {
        return skuPropertyValueMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<SkuPropertyValue> getAll() {
        return skuPropertyValueMapper.selectAll();
    }

    @Override
    public List<SkuPropertyValue> selectBySkuPropertyId(Long id) {
        return skuPropertyValueMapper.getSkuPropertyValue(id);
    }
    @Override
    public List<SkuPropertyValue> selectVoBySkuPropertyId(Long id) {
        return skuPropertyValueMapper.getSkuPropertyVoValue(id);
    }
}
